/*******************************************************************
* Type conversion errors, Project Property Tab set Character to Not Set 
*******************************************************************/

#include <dsound.h>

#include "dsutil.h"

class Sound
{
public:
	Sound();

	bool initDirectSound(HWND hwnd);
	void shutdownDirectSound();
	LPDIRECTSOUNDBUFFER LoadWaveToSoundBuffer();
	void playSound();
	void playSoundLoop();
	void stopSound();
	void Update(float elapsedTime);

	void setHWND(HWND a_hwnd);
	void setFilename(char *a_sFilename);
	void setBuffer(LPDIRECTSOUNDBUFFER a_pBuffer);
	void setVol(long a_lVol);
	void setPan(long a_lPan);
	void setFreq(DWORD a_dFreq, float a_fFreqDivisor);

	HWND getHWND() { return m_hwnd; }
	char* getFilename() { return m_sFilename; }
	LPDIRECTSOUNDBUFFER getBuffer() { return m_pBuffer; }
	long getVol() { return m_lVol; }
	long getPan() { return m_lPan; }
	DWORD getFreq() { return m_dFreq; }
	float getDur() { return m_fDur; }
	float getTimer() { return m_timer; }

private:
	LPDIRECTSOUND8			g_pDS;			// Variable for holding the DirectSound Device
	HWND					m_hwnd;
	char*					m_sFilename; 
	LPDIRECTSOUNDBUFFER		m_pBuffer;
	long					m_lVol;
	long					m_lPan;
	DWORD					m_dFreq;
	float					m_fDur;
	float					m_timer;
};

